﻿<UserControl x:Class="SuperQuery.UserControls.AddDatabaseWizard.ServerDetailsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:sqcon="clr-namespace:SuperQuery.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <sqcon:InverseBoolConverter x:Key="InverseBool"/>
    </UserControl.Resources>
    
    <DockPanel LastChildFill="False">

        <!--Instructions-->
        <TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" Margin="5">
            Enter the server name and log on details for the server to scan for databases:
        </TextBlock>
        
        <!--Server Name-->
        <DockPanel DockPanel.Dock="Top">
            <Label Style="{StaticResource dialogLabel}" KeyboardNavigation.TabIndex="0">Server Name:</Label>
            <TextBox Style="{StaticResource dialogTextbox}" Text="{Binding Path=ServerName, Mode=TwoWay}"
                     KeyboardNavigation.TabIndex="1"/>
        </DockPanel>

        <!--Windows Authentication Checkbox-->
        <CheckBox x:Name="chkWindowsAuthentication" DockPanel.Dock="Top" Style="{StaticResource winAuth}"
                  KeyboardNavigation.TabIndex="2" IsChecked="{Binding Path=WindowsAuthentication, Mode=TwoWay}">
            Use Windows Authentication
        </CheckBox>
        
        <!--Security Details-->
        <GroupBox DockPanel.Dock="Top" Header="Security Details" Style="{StaticResource serverDetails}"
                  IsEnabled="{Binding ElementName=chkWindowsAuthentication, Path=IsChecked, Converter={StaticResource InverseBool}}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="90"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                
                <!--User name-->
                <Label Style="{StaticResource dialogLabel}" Grid.Row="0" Grid.Column="0" KeyboardNavigation.TabIndex="3">User Name:</Label>
                <TextBox Style="{StaticResource dialogTextbox}" Grid.Row="0" Grid.Column="1" KeyboardNavigation.TabIndex="4"
                         Text="{Binding Path=UserName, Mode=TwoWay}"/>

                <!--Password-->
                <Label Style="{StaticResource dialogLabel}" Grid.Row="1" Grid.Column="0" KeyboardNavigation.TabIndex="5">Password:</Label>
                <TextBox Style="{StaticResource dialogTextbox}" Grid.Row="1" Grid.Column="1" KeyboardNavigation.TabIndex="6"
                         Text="{Binding Path=Password, Mode=TwoWay}"/>
            </Grid>
        </GroupBox>
    </DockPanel>
</UserControl>
